feat(convergence): add review_targets table — #1025 state migration - #1052
Merged
Conversation
…state migration The one missing stateful table in the reviewbot→gittensory migration. Already-ported code (src/review/ops.ts health queries, src/review/submitter-reputation.ts live signal) reads review_targets but it never existed in gittensory. Folds reviewbot's accumulated schema (0001+0003/0005/0006/0007/0010) into one CREATE: decided_sha/decision_json (per-head_sha decision cache) + approved_sha (approve-once-per-commit) prevent the re-review storm on cutover. Raw-SQL-only (matching the 0046-0049 parity-store convention); review_audit FK deliberately omitted (0049 already dropped it). The remote table + data seed (3233 review_targets, +24 submitter_stats merged, 125586 review_audit) were applied out-of-band; this file keeps migrations/ and d1_migrations consistent.
|
Note 🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦 💡 Gittensory review — advisory only
💡 Advisory only — no action taken
💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers. |
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1052 +/- ##
===========================================
+ Coverage 71.63% 96.75% +25.11%
===========================================
Files 143 143
Lines 17580 17580
Branches 6364 6364
===========================================
+ Hits 12594 17010 +4416
+ Misses 3825 108 -3717
+ Partials 1161 462 -699 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
JSONbored
added a commit
that referenced
this pull request
Jun 22, 2026
…ke timers) The test drove an async flow — real WebCrypto token-decrypt + async D1/fetch interleaved with one setTimeout(sleep 3000) — via a fake-timer pump loop. Under CI full-shard coverage load the real macrotask lagged the microtask flush the pump relied on, so the scheduled sleep was never fired and the test HUNG → 15s timeout (the CI-only flake that blocked #1050/#1051/#1052/#1056). Fix: drop fake timers entirely. Mock setTimeout so the sleep(3000) backoff fires on a real 0ms tick, then await processSubmitDraft directly — the flow runs to completion on the real event loop (probe 404 → instant backoff → probe 200 → open PR) with no pump, no race, no real 3s wait, no weakened assertions. Verified stable across 6+ consecutive plain + coverage runs locally.
JSONbored
added a commit
that referenced
this pull request
Jun 22, 2026
…ke timers) (#1057) The test drove an async flow — real WebCrypto token-decrypt + async D1/fetch interleaved with one setTimeout(sleep 3000) — via a fake-timer pump loop. Under CI full-shard coverage load the real macrotask lagged the microtask flush the pump relied on, so the scheduled sleep was never fired and the test HUNG → 15s timeout (the CI-only flake that blocked #1050/#1051/#1052/#1056). Fix: drop fake timers entirely. Mock setTimeout so the sleep(3000) backoff fires on a real 0ms tick, then await processSubmitDraft directly — the flow runs to completion on the real event loop (probe 404 → instant backoff → probe 200 → open PR) with no pump, no race, no real 3s wait, no weakened assertions. Verified stable across 6+ consecutive plain + coverage runs locally.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
migrations/0050_review_targets.sql— the one missing stateful table in the reviewbot → gittensory state migration (#1025). gittensory already provisioned the other 4 stateful tables (submitter_stats 0046, tunables 0047, review_audit 0049), but had noreview_targets, even though already-ported code reads it (src/review/ops.ts,src/review/submitter-reputation.ts).review_targetscarries the two load-bearing concepts as columns:decided_sha+decision_json) — terminal verdict computed once per commitapproved_sha)Data migration (applied out-of-band to remote)
The remote table + data seed were applied directly (reviewbot D1 → gittensory D1, export→transform→import, all idempotent upserts, reviewbot read-only throughout). Verified:
source='reviewbot')projectremapped slug → full-name (gittensory→JSONbored/gittensory) to match gittensory's native conventionThis file keeps
migrations/and thed1_migrationstable consistent (the migration is already recorded as applied on remote, so deploy-timemigrations applyis a no-op).Part of convergence epic #983 / #1025.